package com.fansl.allround.open.api.feign;

import com.fansl.allround.common.core.constant.ServiceNameConstants;
import com.fansl.allround.common.core.util.R;
import com.fansl.allround.open.api.entity.sms.SendSmsCodePO;
import com.fansl.allround.open.api.feign.factory.RemoteJuHeServiceFallbackFactory;
import com.fansl.allround.open.api.vo.NewsHeadlinesVO;
import com.fansl.allround.open.api.vo.SmsCodeVO;
import com.fansl.allround.open.api.vo.WeatherVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author fansl
 * @Description: TODO
 * @date 2019/9/10 18:56
 */
@FeignClient(contextId = "remoteJuHeService",value = ServiceNameConstants.OPEN_SERVICE,
        fallbackFactory = RemoteJuHeServiceFallbackFactory.class,path = "/juhe")
public interface RemoteJuHeService {
    /**
     * 聚合api-查询新闻头条
     * @param newsType
     * @return
     */
    @GetMapping("/newsHeadlines/{newsType}")
    List<NewsHeadlinesVO> newsHeadlines(@PathVariable(name = "newsType") String newsType);

    /**
     * 聚合api-查询天气
     * @param cityName
     * @return
     */
    @GetMapping("/weather")
    WeatherVO weather(@RequestParam(name = "cityName") String cityName);

    /**
     * 聚合api-发送手机验证码
     * @param smsCodePO
     * @return
     */
    @PostMapping("/sms")
    SmsCodeVO smsCode(@RequestBody SendSmsCodePO smsCodePO);
}
